package com.hengjun.baccarat.net;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.CoreConnectionPNames;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;

import com.hengjun.baccarat.common.PostDataHolder;
import com.hengjun.baccarat.pojo.CellObject2;
import com.hengjun.baccarat.pojo.ViewDataObject;
import com.hengjun.baccarat.utils.BcSysUser;
import com.hengjun.baccarat.utils.GetJSON;
import com.hengjun.baccarat.utils.RecordCore;

import android.util.Log;
import android.widget.Toast;

public class UrlConn {
	public static final String HOST = "192.168.0.106";
	private static final int PORT = 8080;
	private static final String SERVERNAME = "DMserver";
	private static final String LoginRequst = "sysuser/bacCartSysuser-queryBcSysuer.action";
	private static final String QueryTotalMatch = "sysuser/bacCartSysuser-queryCellObjectHistroyCellObjectMatch.action";
	private static final String Record = "record/record-queryRecordCore.action";
	private static final String Query = "sysuser/bacCartSysuser-downLoad2.action";
	private static final String UpLoad = "sysuser/bacCartSysuser-getUpLoad3.action";
	private static final String UpLoadMacAdd = "register/registerComputer-queryComputerBydiskID.action";
	private static final String UpLoadRegister = "register/registerComputer-addNewComputerNotKey.action";
	private static final String QueryPort = "record/record-queryRecordCoreByRecordIndex.action";
	private static final String backUpload = "betting/betting-BackBettingResult.action";
	private static final String UpdateSoft = "http://home.myvip18.com:8080/UpdateWizardServer/updateWizard";//更新软件
	public static final String UpdateSoft2 = "http://home.myvip18.com:8080/UpdateWizardServer";//下载apk
	public static final int REQUEST_TIMEOUT = 20 * 1000;

	// private static final int SO_TIMEOUT = 10*1000; //�����嚙踝蕭����謑迎蕭��ㄗ10���蕭

	public static String LoginConnection(String account, String password)
			throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ LoginRequst;
		String strResult = null;
		try {
			HttpPost httpRequest = new HttpPost(httpUrl);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("userName", account));
			params.add(new BasicNameValuePair("passWord", password));
			params.add(new BasicNameValuePair("version", "112"));
			HttpEntity httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);
			HttpConnectionParams.setSoTimeout(httpParams, REQUEST_TIMEOUT);
			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);

			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				strResult = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);
				GetJSON.setLoginJson(strResult);
			}
			return strResult;
		} catch (Exception e) {
			throw e;
		}
	}

	public static List<RecordCore> RecordConn() throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ Record;
		List<RecordCore> rcList = new ArrayList<RecordCore>();
		try {
			HttpPost httpRequest = new HttpPost(httpUrl);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("bacCartSysuerIndex", BcSysUser
					.getbcSysUser().getUserIndex() + ""));
			params.add(new BasicNameValuePair("start", "0"));
			params.add(new BasicNameValuePair("limit", "100"));
			params.add(new BasicNameValuePair("finshtimeFlag", "0"));
			HttpEntity httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);
			HttpConnectionParams.setSoTimeout(httpParams, REQUEST_TIMEOUT);
			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);

			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				String strResult = EntityUtils.toString(
						httpResponse.getEntity(), HTTP.UTF_8);
				rcList = GetJSON.setListJson(strResult);
			}
			return rcList;
		} catch (Exception e) {
			throw e;
		}
	}

	public static void ListQuery(String recordindex) throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ Query;
		try {
			HttpPost httpRequest = new HttpPost(httpUrl);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("userIndex", BcSysUser
					.getbcSysUser().getUserIndex().toString()));
			params.add(new BasicNameValuePair("findex", BcSysUser
					.getbcSysUser().getFindex().toString()));
			params.add(new BasicNameValuePair("recordindex", recordindex));
			HttpEntity httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);

			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);

			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				String strResult = EntityUtils.toString(
						httpResponse.getEntity(), HTTP.UTF_8);

				GetJSON.getRowList(strResult);
			} else {
			}
		} catch (Exception e) {
			throw e;
		}
	}

	public static String queryPort(String recordIndex) throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ QueryPort;
		String strResult = "";
		HttpPost httpRequest = new HttpPost(httpUrl);
		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("bacCartSysuerIndex", BcSysUser
				.getbcSysUser().getUserIndex() + ""));
		params.add(new BasicNameValuePair("recordIndex", recordIndex));
		HttpEntity httpentity;
		try {
			httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);

			HttpClient httpclient = new DefaultHttpClient(httpParams);

			HttpResponse httpResponse = httpclient.execute(httpRequest);
			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				strResult = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);
			}
			return strResult;
		} catch (Exception e) {
			throw e;
		}
	}

	public synchronized static String ListUpLoad(String recordIndex,
			String userIndex, String streetType, String streetList,
			String bettingResult) throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ UpLoad;
		String strResult = null;
		try {
			HttpPost httpRequest = new HttpPost(httpUrl);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("recordindex", recordIndex));
			params.add(new BasicNameValuePair("userIndex", userIndex));
			params.add(new BasicNameValuePair("streetType", streetType));
			// ��嚙踝蕭���蕭��蕭嚙踐�齒"null"
			if (bettingResult.equals("null")) {
				params.add(new BasicNameValuePair("BigStreetList", ""));
			} else {
				params.add(new BasicNameValuePair("BigStreetList", streetList));
			}

			List<String> bettingResultList = ViewDataObject.getViewDataObject()
					.getBettingResultList();
			if (bettingResultList.size() > 0) {
				for (String betting : bettingResultList) {
					params.add(new BasicNameValuePair("betting", betting));
				}
			}
			if (streetType.equals("0")) {

				if (streetList.equals("") && !bettingResult.equals("null")
						&& !bettingResult.equals("backNull")) {
					params.add(new BasicNameValuePair("bettingResult", ""));
					params.add(new BasicNameValuePair("Isreset", "reset"));
				} else if (streetList.equals("")
						&& bettingResult.equals("backNull")) {
					params.add(new BasicNameValuePair("backNull", "backNull"));
				} else {
					params.add(new BasicNameValuePair("bettingResult",
							bettingResult));
				}
			}
			// PostDataHolder po=new PostDataHolder();
			// // org.apache.commons.httpclient.NameValuePair[] pair=new
			// org.apache.commons.httpclient.NameValuePair[params.size()];
			//
			//
			// List<org.apache.commons.httpclient.NameValuePair> params = new
			// ArrayList<org.apache.commons.httpclient.NameValuePair>();
			//
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("recordindex",
			// recordIndex));
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("userIndex",
			// userIndex));
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("streetType",
			// streetType));
			// // ��嚙踝蕭���蕭��蕭嚙踐�齒"null"
			// if (bettingResult.equals("null")) {
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("BigStreetList",
			// ""));
			// } else {
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("BigStreetList",
			// streetList));
			// }
			//
			// List<String> bettingResultList =
			// ViewDataObject.getViewDataObject()
			// .getBettingResultList();
			// if (bettingResultList.size() > 0) {
			// for (String betting : bettingResultList) {
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("betting", betting));
			// }
			// }
			// if (streetType.equals("0")) {
			//
			// if (streetList.equals("") &&
			// !bettingResult.equals("null")&&!bettingResult.equals("backNull"))
			// {
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("bettingResult",
			// ""));
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("Isreset", "reset"));
			// }
			// else if(streetList.equals("") &&
			// bettingResult.equals("backNull")){
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("backNull",
			// "backNull"));
			// }
			// else {
			// params.add(new
			// org.apache.commons.httpclient.NameValuePair("bettingResult",
			// bettingResult));
			// }
			// }
			//
			// org.apache.commons.httpclient.NameValuePair[] pairs=new
			// org.apache.commons.httpclient.NameValuePair[params.size()];
			// for(int i=0;i<params.size();i++){
			//
			// pairs[i]=params.get(i);
			// }
			//
			// po.getDataFromServer(httpUrl, pairs);

			HttpEntity httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);

			HttpClient httpclient = new DefaultHttpClient(httpParams);
			httpclient.getParams().setParameter(
					CoreConnectionPNames.SO_TIMEOUT, REQUEST_TIMEOUT);
			HttpResponse httpResponse = httpclient.execute(httpRequest);

			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				strResult = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);
			}
			return strResult;
		} catch (Exception e) {
			throw e;
		}
	}

	public synchronized static String ListUpLoad2(String recordIndex,
			String userIndex, String streetType, String streetList,
			String bettingResult, String bigEyeList, String littleEyeList,
			String xiaoQiangList) throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ UpLoad;
		String strResult = null;
		try {
			PostDataHolder po = new PostDataHolder();
			List<org.apache.commons.httpclient.NameValuePair> params = new ArrayList<org.apache.commons.httpclient.NameValuePair>();
			params.add(new org.apache.commons.httpclient.NameValuePair(
					"recordindex", recordIndex));
			params.add(new org.apache.commons.httpclient.NameValuePair(
					"userIndex", userIndex));
			params.add(new org.apache.commons.httpclient.NameValuePair(
					"streetType", streetType));
			params.add(new org.apache.commons.httpclient.NameValuePair(
					"bigEyeList", bigEyeList));
			params.add(new org.apache.commons.httpclient.NameValuePair(
					"littleEyeList", littleEyeList));
			params.add(new org.apache.commons.httpclient.NameValuePair(
					"xiaoQiangList", xiaoQiangList));
			// ��嚙踝蕭���蕭��蕭嚙踐�齒"null"
			if (bettingResult.equals("null")) {
				params.add(new org.apache.commons.httpclient.NameValuePair(
						"BigStreetList", ""));
			} else {
				params.add(new org.apache.commons.httpclient.NameValuePair(
						"BigStreetList", streetList));
			}

			List<String> bettingResultList = ViewDataObject.getViewDataObject()
					.getBettingResultList();
			if (bettingResultList.size() > 0) {
				for (String betting : bettingResultList) {
					params.add(new org.apache.commons.httpclient.NameValuePair(
							"betting", betting));
				}
			}
			if (streetType.equals("0")) {

				if (streetList.equals("") && !bettingResult.equals("null")
						&& !bettingResult.equals("backNull")) {
					params.add(new org.apache.commons.httpclient.NameValuePair(
							"bettingResult", ""));
					params.add(new org.apache.commons.httpclient.NameValuePair(
							"Isreset", "reset"));
				} else if (streetList.equals("")
						&& bettingResult.equals("backNull")) {
					params.add(new org.apache.commons.httpclient.NameValuePair(
							"backNull", "backNull"));
				} else {
					params.add(new org.apache.commons.httpclient.NameValuePair(
							"bettingResult", bettingResult));
				}
			}

			org.apache.commons.httpclient.NameValuePair[] pairs = new org.apache.commons.httpclient.NameValuePair[params
					.size()];
			for (int i = 0; i < params.size(); i++) {

				pairs[i] = params.get(i);
			}

			po.getDataFromServer(httpUrl, pairs);

			return strResult;
		} catch (Exception e) {
			throw e;
		}
	}

	public static String CheckMacAdd(String macAdd) throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ UpLoadMacAdd;
		String strResult = null;
		try {
			HttpPost httpRequest = new HttpPost(httpUrl);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("diskID", macAdd + ":android"));
			HttpEntity httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);

			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);

			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				strResult = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);
			}
			return strResult;
		} catch (Exception e) {
			throw e;
		}

	}

	public static String UploadRegister(String userName, String password,
			String imie, String osNumber, String diviceType, String endDate,
			String beizhu) throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ UpLoadRegister;
		String strResult = null;
		try {
			HttpPost httpRequest = new HttpPost(httpUrl);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("name", userName));
			params.add(new BasicNameValuePair("password", password));
			params.add(new BasicNameValuePair("diskID", imie));
			params.add(new BasicNameValuePair("OsNumber", osNumber));
			params.add(new BasicNameValuePair("devicetype", diviceType));
			params.add(new BasicNameValuePair("enddate", endDate));
			params.add(new BasicNameValuePair("remark", beizhu));
			HttpEntity httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);

			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);

			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				strResult = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);

			}
			return strResult;
		} catch (Exception e) {
			throw e;
		}
	}

	public static double getBackMoney() throws Exception {
		double backMoney = 0d;
		if (ViewDataObject.getViewDataObject().getBettingResultList().size() > 0) {
			List<String> lastStringList = ViewDataObject.getViewDataObject()
					.getBettingResultList();
			String lastString = lastStringList.get(lastStringList.size() - 1);
			JSONObject jb = new JSONObject(lastString);
			backMoney = jb.getDouble("resultWin") + jb.getDouble("addMoney");
		}

		return backMoney;
	}

	public static double backUpload(String recordIndex) throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ backUpload;
		String result = "";
		double resultWin = 0d;
		try {
			HttpPost httpRequest = new HttpPost(httpUrl);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("recordindex", recordIndex));

			HttpEntity httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);

			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);

			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				result = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);
				resultWin = Double.parseDouble(result);
				List<Object> bigStreetList = ViewDataObject.getViewDataObject()
						.getBigStreetArrayList();
				if (bigStreetList.size() > 0) {
					int index = bigStreetList.size() - 1;
					@SuppressWarnings("unchecked")
					List<CellObject2> celObject2s = (List<CellObject2>) bigStreetList
							.get(index);
					int index2 = celObject2s.size() - 1;
					CellObject2 cell2 = celObject2s.get(index2);
					cell2.setWinTotal(cell2.getWinTotal() - resultWin);
					celObject2s.set(index2, cell2);
					bigStreetList.set(index, celObject2s);
					ViewDataObject.getViewDataObject().setBigStreetArrayList(
							bigStreetList);
				}
			}
			return resultWin;
		} catch (Exception e) {
			throw e;
		}
	}

	public static String getUpdateSoftURL() throws Exception {
		String strResult = null;

		try {
			HttpPost httpRequest = new HttpPost(UpdateSoft);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("tag", "23"));
			HttpEntity httpentity;
			httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);

			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);

			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				strResult = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);
			}
//			Log.e("test","getUpdateSoftURL=="+strResult);
			System.out.println("getUpdateSoftURL=="+strResult);
			return strResult;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			throw e;
		}
	}

	public static String getUpdateSoftXML(String url) throws Exception {
		String strResult = null;

		try {
			String httpUrl = UpdateSoft2 + "/" + url;
			HttpPost httpRequest = new HttpPost(httpUrl);
			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);
			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);
			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				strResult = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);
			}
			return strResult;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			throw e;
		}
	}

	/**
	 * 获取更新信息
	 * @param readMe
	 * @return
	 * @throws Exception
	 */
	public static String getUpdateReadME(String readMe) throws Exception {
		String strResult = null;

		try {
			String httpUrl = UpdateSoft2 + "/androidBacarat/update/" + readMe;
			HttpPost httpRequest = new HttpPost(httpUrl);
			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);
			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);
			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				strResult = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);
			}
			return strResult;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			throw e;
		}
	}

	public static String getTotalMatch(String recordIndex) throws Exception {
		String httpUrl = "http://" + HOST + ":" + PORT + "/" + SERVERNAME + "/"
				+ QueryTotalMatch;
		String strResult = null;
		try {
			HttpPost httpRequest = new HttpPost(httpUrl);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("recordindex", recordIndex));
			HttpEntity httpentity = new UrlEncodedFormEntity(params, "UTF-8");
			httpRequest.setEntity(httpentity);

			BasicHttpParams httpParams = new BasicHttpParams();
			HttpConnectionParams.setConnectionTimeout(httpParams,
					REQUEST_TIMEOUT);
			HttpConnectionParams.setSoTimeout(httpParams, REQUEST_TIMEOUT);
			HttpClient httpclient = new DefaultHttpClient(httpParams);
			HttpResponse httpResponse = httpclient.execute(httpRequest);

			if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				strResult = EntityUtils.toString(httpResponse.getEntity(),
						HTTP.UTF_8);
				// GetJSON.setLoginJson(strResult);
			}
			return strResult;
		} catch (Exception e) {
			throw e;
		}
	}
}
